<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="spring" uri="/WEB-INF/tlds/spring.tld"%>
<%@ taglib prefix="c" uri="/WEB-INF/tlds/c.tld"%>
<c:set var="BasePath" value="${pageContext.request.contextPath}"></c:set>
<c:set var="Plugins" value="${pageContext.request.contextPath}/res/plugins"></c:set>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>供应链账户列表</title>
<link href="${Plugins}/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
<link href="${Plugins}/ligerUI/skins/ligerui-icons.css" rel="stylesheet" type="text/css" />
<script src="${Plugins}/jquery/jquery-1.3.2.min.js"	type="text/javascript"></script>
<script src="${Plugins}/ligerUI/js/ligerui.min.js" type="text/javascript"></script>
<link href="${BasePath}/res/css/common/liger-hack.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${BasePath}/res/js/ligerCommon.js"></script>
<script type="text/javascript" src="${BasePath}/res/js/user/user.js"></script>
<style type="text/css">
#searchbar{
	margin-bottom: 10px;
}
.navbar {
		height: 20px;
		border-bottom: #E6E6E6 solid 1px;
		line-height: 20px;
	}
.l-button-search {
	width: 50px;
	margin-left: 10px;
	padding-bottom: 2px;
	display: inline;
}
</style>
</head>
<body style="padding:6px; overflow:hidden;">
<div id="">
	<div class="navbar"><span>您当前的位置：系统管理 &gt;供应链账户列表 </span></div>
	<br/>
	<form action="#"  name="queryForm" id="queryForm" method="POST">
		真实姓名：<input type="text" id="realName" name="realName" size="30" maxLength="40" value="${userVo.realName }">&nbsp;&nbsp;&nbsp;&nbsp;
		登录用户名：<input type="text" id="userName" name="userName" size="30" maxLength="150" value="${userVo.userName }" style="ime-mode:disabled">&nbsp;&nbsp;&nbsp;&nbsp;
		<input  type="submit" value="查询" class="l-button-search" >&nbsp;&nbsp;&nbsp;&nbsp;<input  type="button" id="resetButton" value="重置" class="l-button-search" >
	</form>
	<br/>
</div>
<div id="maingrid6" style="margin:0; padding:0"></div>
  <div style="display:none;">
  <!-- g data total ttt -->
</div>
<script type="text/javascript">
    var grid = null;
    $(function () {
	    $('#resetButton').click(function() {
	    	$('#realName').val('');
	    	$('#userName').val('');
	    });
        grid = $("#maingrid6").ligerGrid({
            columns: [
            { display: '真实姓名', name: 'realName', align: 'left', width: '30%' },
            { display: '登录用户名', name: 'userName',align: 'left', width: '30%' },
            { display: '状态', name: 'userStatus', width:'10%', render: function(rowdata, rowindex, value) {
            	if (value == 1) {
            		return "正常";
            	} else {
            		return "已锁定";
            	}
            } },
            { display: '操作', isSort: false, width: '30%', render: function(rowdata, rowindex, value){
                    var h = "";
                    h += "<a href='javascript:toModifyUser(" + rowindex + ")'>修改</a> ";
                   	h += "<a href='javascript:toModifyPassword(" + rowindex + ")'>修改密码</a> ";
                    if(rowdata.userNature != 2 && '${uv.userNature}' == '2') {
                   		h += "<a href='javascript:toAllocateRole(" + rowindex + ")'>分配角色</a> ";
                       	if(rowdata.userStatus == 1) h += "<a href='javascript:lockUser(" + rowindex + ")'>锁定</a> ";
                       	else h += "<a href='javascript:unlockUser(" + rowindex + ")'>解锁</a> ";
                       	h += "<a href='javascript:deleteUser(" + rowindex + ")'>删除</a> ";
                    }
                    return h;
                }
            }
            ], 
            pageSize:30,
            width: '100%',
            height: '100%',
            dataType: 'server', 
            dataAction: 'server',
            pagesizeParmName: 'pageSize',
            parms: [
                    {name: "realName", value:$("#realName").val()},
                    {name: "userName", value:$("#userName").val()}
            	],
            url: "ajaxToUserList.do",
            toolbar: { items: [
                           	{ text: "新  增", click: toAddUser, icon: "add"}
                           ]}
        });
        $("#pageloading").hide();
    });

</script>
</body>
</html>